<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        $table = sprintf("reasonable_%s", date("Y-m-d"));
        Schema::create($table, function (Blueprint $table) {
            $table->integer('id')->autoIncrement();
            $table->string('error_code', 30)->nullable()->comment('错误码');
            $table->text('error_message')->nullable()->comment('错误消息');
            $table->string('error_file_path', 255)->nullable()->comment('文件路径');
            $table->integer('error_file_line')->nullable()->comment('行号');
            $table->longtext('error_trace')->nullable()->comment('错误trace');
            $table->datetime('created_at')->nullable()->comment('创建时间');
            $table->datetime('updated_at')->nullable()->comment('更新时间');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        // Schema::dropIfExists('reasonable');
    }
};
